<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // continue 跳过本次循环 进行下一次循环
    // break 跳出整个循环
    for (let i = 1; i <= 10; i++) {
      if (i === 5) {
        break;
      }
      document.write(i + ' <br>')
    }

    document.write('------------------ <br>')
    // 打印1 - 10之间的所有奇数
    for (let i = 1; i <= 10; i++) {
      if (i % 2 === 0) {
        continue;
      }
      document.write(i + ' <br>')
    }

    // // 无限循环
    // for(; ;) {
    //   document.write('hello world <br>')
    // }
  </script>
</body>

</html>